<!-- HTML header for doxygen 1.8.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/xhtml;charset=utf-8" http-equiv="Content-Type"/>
<meta content="IE=9" http-equiv="X-UA-Compatible"/>
<meta content="Doxygen 1.8.13" name="generator"/>
<title>OpenCV: Miscellaneous Image Transformations</title>
<link href="../../opencv.ico" rel="shortcut icon" type="image/x-icon"/>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script src="../../jquery.js" type="text/javascript"></script>
<script src="../../dynsections.js" type="text/javascript"></script>
<script src="../../tutorial-utils.js" type="text/javascript"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script src="../../search/searchdata.js" type="text/javascript"></script>
<script src="../../search/search.js" type="text/javascript"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
//<![CDATA[
MathJax.Hub.Config(
{
  TeX: {
      Macros: {
          matTT: [ "\\[ \\left|\\begin{array}{ccc} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{array}\\right| \\]", 9],
          fork: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ \\end{array} \\right.", 4],
          forkthree: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ \\end{array} \\right.", 6],
          forkfour: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ #7 & \\mbox{#8}\\\\ \\end{array} \\right.", 8],
          vecthree: ["\\begin{bmatrix} #1\\\\ #2\\\\ #3 \\end{bmatrix}", 3],
          vecthreethree: ["\\begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{bmatrix}", 9],
          cameramatrix: ["#1 = \\begin{bmatrix} f_x & 0 & c_x\\\\ 0 & f_y & c_y\\\\ 0 & 0 & 1 \\end{bmatrix}", 1],
          distcoeffs: ["(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]]) \\text{ of 4, 5, 8, 12 or 14 elements}"],
          distcoeffsfisheye: ["(k_1, k_2, k_3, k_4)"],
          hdotsfor: ["\\dots", 1],
          mathbbm: ["\\mathbb{#1}", 1],
          bordermatrix: ["\\matrix{#1}", 1]
      }
  }
}
);
//]]>
</script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js" type="text/javascript"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css"/>
<link href="../../stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<!--#include virtual="/google-search.html"-->
<table cellpadding="0" cellspacing="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../opencv-logo-small.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenCV
    <span id="projectnumber">4.5.2</span>
   </div>
   <div id="projectbrief">Open Source Computer Vision</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
<script src="../../menudata.js" type="text/javascript"></script>
<script src="../../menu.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow" onkeydown="return searchBox.OnSearchSelectKey(event)" onmouseout="return searchBox.OnSearchSelectHide()" onmouseover="return searchBox.OnSearchSelectShow()">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe frameborder="0" id="MSearchResults" name="MSearchResults" src="javascript:void(0)">
</iframe>
</div>
<div class="header">
  <div class="summary">
<a href="#enum-members">Enumerations</a> |
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Miscellaneous Image Transformations<div class="ingroups"><a class="el" href="../../d7/dbd/group__imgproc.html">Image Processing</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:gaa42a3e6ef26247da787bf34030ed772c"><td align="right" class="memItemLeft" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d1b/group__imgproc__misc.html#gaa42a3e6ef26247da787bf34030ed772c">cv::AdaptiveThresholdTypes</a> { <br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa42a3e6ef26247da787bf34030ed772cad0c5199ae8637a6b195062fea4789fa9">cv::ADAPTIVE_THRESH_MEAN_C</a> = 0, 
<br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa42a3e6ef26247da787bf34030ed772caf262a01e7a3f112bbab4e8d8e28182dd">cv::ADAPTIVE_THRESH_GAUSSIAN_C</a> = 1
<br/>
 }</td></tr>
<tr class="separator:gaa42a3e6ef26247da787bf34030ed772c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga3fe343d63844c40318ee627bd1c1c42f"><td align="right" class="memItemLeft" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d1b/group__imgproc__misc.html#ga3fe343d63844c40318ee627bd1c1c42f">cv::DistanceTransformLabelTypes</a> { <br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#gga3fe343d63844c40318ee627bd1c1c42fa631de3e838ee72d6a9d991b8fbce4c1d">cv::DIST_LABEL_CCOMP</a> = 0, 
<br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#gga3fe343d63844c40318ee627bd1c1c42fa5d291835de98b72caa12a9947c2cd92a">cv::DIST_LABEL_PIXEL</a> = 1
<br/>
 }<tr class="memdesc:ga3fe343d63844c40318ee627bd1c1c42f"><td class="mdescLeft"> </td><td class="mdescRight">distanceTransform algorithm flags  <a href="../../d7/d1b/group__imgproc__misc.html#ga3fe343d63844c40318ee627bd1c1c42f">More...</a><br/></td></tr>
</td></tr>
<tr class="separator:ga3fe343d63844c40318ee627bd1c1c42f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaaa68392323ccf7fad87570e41259b497"><td align="right" class="memItemLeft" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d1b/group__imgproc__misc.html#gaaa68392323ccf7fad87570e41259b497">cv::DistanceTransformMasks</a> { <br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaaa68392323ccf7fad87570e41259b497a520d4f90e1e37d13d7592fd295a6b5b2">cv::DIST_MASK_3</a> = 3, 
<br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaaa68392323ccf7fad87570e41259b497a8a8b17ed6012f6ce42e56f302c07d481">cv::DIST_MASK_5</a> = 5, 
<br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaaa68392323ccf7fad87570e41259b497a71e13e06c1d12eabd2acd2669f94f9ca">cv::DIST_MASK_PRECISE</a> = 0
<br/>
 }<tr class="memdesc:gaaa68392323ccf7fad87570e41259b497"><td class="mdescLeft"> </td><td class="mdescRight">Mask size for distance transform.  <a href="../../d7/d1b/group__imgproc__misc.html#gaaa68392323ccf7fad87570e41259b497">More...</a><br/></td></tr>
</td></tr>
<tr class="separator:gaaa68392323ccf7fad87570e41259b497"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaa2bfbebbc5c320526897996aafa1d8eb"><td align="right" class="memItemLeft" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d1b/group__imgproc__misc.html#gaa2bfbebbc5c320526897996aafa1d8eb">cv::DistanceTypes</a> { <br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa2bfbebbc5c320526897996aafa1d8ebaa0bb8d897ba16dbf5a3ca96c71219a32">cv::DIST_USER</a> = -1, 
<br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa2bfbebbc5c320526897996aafa1d8ebae5b2dfaf2ba5024d7ce47885001fad86">cv::DIST_L1</a> = 1, 
<br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa2bfbebbc5c320526897996aafa1d8ebaff0d1f5be0fc152a56a9b9716d158b96">cv::DIST_L2</a> = 2, 
<br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa2bfbebbc5c320526897996aafa1d8eba507b16eb5ef95ea784ca1b3cb7b0d7ee">cv::DIST_C</a> = 3, 
<br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa2bfbebbc5c320526897996aafa1d8eba8f3c18d37e99f7cc58d3605f5c6f9ce9">cv::DIST_L12</a> = 4, 
<br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa2bfbebbc5c320526897996aafa1d8ebaea158f5abd2b5e2b4e79b79f55297079">cv::DIST_FAIR</a> = 5, 
<br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa2bfbebbc5c320526897996aafa1d8ebaba5e4b3600852b7a59e78e3041be840e">cv::DIST_WELSCH</a> = 6, 
<br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa2bfbebbc5c320526897996aafa1d8ebad701f5622a12450d3b8c85c052e7c520">cv::DIST_HUBER</a> = 7
<br/>
 }</td></tr>
<tr class="separator:gaa2bfbebbc5c320526897996aafa1d8eb"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gab87810a476a9cb660435a4cd7871c9eb"><td align="right" class="memItemLeft" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d1b/group__imgproc__misc.html#gab87810a476a9cb660435a4cd7871c9eb">cv::FloodFillFlags</a> { <br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggab87810a476a9cb660435a4cd7871c9eba8aafb7a6a87df91c7624d44f4b092fe3">cv::FLOODFILL_FIXED_RANGE</a> = 1 &lt;&lt; 16, 
<br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggab87810a476a9cb660435a4cd7871c9eba7161dca1d0b9e84e5208c7e8021b4d3a">cv::FLOODFILL_MASK_ONLY</a> = 1 &lt;&lt; 17
<br/>
 }<tr class="memdesc:gab87810a476a9cb660435a4cd7871c9eb"><td class="mdescLeft"> </td><td class="mdescRight">floodfill algorithm flags  <a href="../../d7/d1b/group__imgproc__misc.html#gab87810a476a9cb660435a4cd7871c9eb">More...</a><br/></td></tr>
</td></tr>
<tr class="separator:gab87810a476a9cb660435a4cd7871c9eb"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gad43d3e4208d3cf025d8304156b02ba38"><td align="right" class="memItemLeft" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d1b/group__imgproc__misc.html#gad43d3e4208d3cf025d8304156b02ba38">cv::GrabCutClasses</a> { <br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggad43d3e4208d3cf025d8304156b02ba38a889f1ce109543e8aed80a7abbc6dcb39">cv::GC_BGD</a> = 0, 
<br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggad43d3e4208d3cf025d8304156b02ba38a4757c1f0587bcf6e53e86dee7689a649">cv::GC_FGD</a> = 1, 
<br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggad43d3e4208d3cf025d8304156b02ba38af748414821c7f39fab3493f9eed1eedf">cv::GC_PR_BGD</a> = 2, 
<br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggad43d3e4208d3cf025d8304156b02ba38ad33184b73cb87e08d29e0a3411b7c863">cv::GC_PR_FGD</a> = 3
<br/>
 }<tr class="memdesc:gad43d3e4208d3cf025d8304156b02ba38"><td class="mdescLeft"> </td><td class="mdescRight">class of the pixel in GrabCut algorithm  <a href="../../d7/d1b/group__imgproc__misc.html#gad43d3e4208d3cf025d8304156b02ba38">More...</a><br/></td></tr>
</td></tr>
<tr class="separator:gad43d3e4208d3cf025d8304156b02ba38"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaf8b5832ba85e59fc7a98a2afd034e558"><td align="right" class="memItemLeft" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d1b/group__imgproc__misc.html#gaf8b5832ba85e59fc7a98a2afd034e558">cv::GrabCutModes</a> { <br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaf8b5832ba85e59fc7a98a2afd034e558a5f8853c1e5a89c4aa2687d1f78a7e550">cv::GC_INIT_WITH_RECT</a> = 0, 
<br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaf8b5832ba85e59fc7a98a2afd034e558ab01527c7effb50fd1c54d8c4e671ed22">cv::GC_INIT_WITH_MASK</a> = 1, 
<br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaf8b5832ba85e59fc7a98a2afd034e558aef3752e3c27c4af9445d0b5590b6aa05">cv::GC_EVAL</a> = 2, 
<br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaf8b5832ba85e59fc7a98a2afd034e558a98122ab15c638309a71a1856c3f43a09">cv::GC_EVAL_FREEZE_MODEL</a> = 3
<br/>
 }<tr class="memdesc:gaf8b5832ba85e59fc7a98a2afd034e558"><td class="mdescLeft"> </td><td class="mdescRight">GrabCut algorithm flags.  <a href="../../d7/d1b/group__imgproc__misc.html#gaf8b5832ba85e59fc7a98a2afd034e558">More...</a><br/></td></tr>
</td></tr>
<tr class="separator:gaf8b5832ba85e59fc7a98a2afd034e558"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaa9e58d2860d4afa658ef70a9b1115576"><td align="right" class="memItemLeft" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d1b/group__imgproc__misc.html#gaa9e58d2860d4afa658ef70a9b1115576">cv::ThresholdTypes</a> { <br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa9e58d2860d4afa658ef70a9b1115576a147222a96556ebc1d948b372bcd7ac59">cv::THRESH_BINARY</a> = 0, 
<br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa9e58d2860d4afa658ef70a9b1115576a19120b1a11d8067576cc24f4d2f03754">cv::THRESH_BINARY_INV</a> = 1, 
<br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa9e58d2860d4afa658ef70a9b1115576ac7e89a5e95490116e7d2082b3096b2b8">cv::THRESH_TRUNC</a> = 2, 
<br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa9e58d2860d4afa658ef70a9b1115576a0e50a338a4b711a8c48f06a6b105dd98">cv::THRESH_TOZERO</a> = 3, 
<br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa9e58d2860d4afa658ef70a9b1115576a47518a30aae90d799035bdcf0bb39a50">cv::THRESH_TOZERO_INV</a> = 4, 
<br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa9e58d2860d4afa658ef70a9b1115576a8e723ef461a5349c391032aee325fe15">cv::THRESH_MASK</a> = 7, 
<br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa9e58d2860d4afa658ef70a9b1115576a95251923e8e22f368ffa86ba8bce87ff">cv::THRESH_OTSU</a> = 8, 
<br/>
  <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa9e58d2860d4afa658ef70a9b1115576a22ffcf680811aed95be6c7f5cd809621">cv::THRESH_TRIANGLE</a> = 16
<br/>
 }</td></tr>
<tr class="separator:gaa9e58d2860d4afa658ef70a9b1115576"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga72b913f352e4a1b1b397736707afcde3"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d1b/group__imgproc__misc.html#ga72b913f352e4a1b1b397736707afcde3">cv::adaptiveThreshold</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst, double maxValue, int adaptiveMethod, int thresholdType, int blockSize, double C)</td></tr>
<tr class="memdesc:ga72b913f352e4a1b1b397736707afcde3"><td class="mdescLeft"> </td><td class="mdescRight">Applies an adaptive threshold to an array.  <a href="../../d7/d1b/group__imgproc__misc.html#ga72b913f352e4a1b1b397736707afcde3">More...</a><br/></td></tr>
<tr class="separator:ga72b913f352e4a1b1b397736707afcde3"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga5e76540a679333d7c6cd0617c452c23d"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d1b/group__imgproc__misc.html#ga5e76540a679333d7c6cd0617c452c23d">cv::blendLinear</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src1, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src2, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> weights1, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> weights2, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst)</td></tr>
<tr class="separator:ga5e76540a679333d7c6cd0617c452c23d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga8a0b7fdfcb7a13dde018988ba3a43042"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d1b/group__imgproc__misc.html#ga8a0b7fdfcb7a13dde018988ba3a43042">cv::distanceTransform</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> labels, int distanceType, int maskSize, int labelType=<a class="el" href="../../d7/d1b/group__imgproc__misc.html#gga3fe343d63844c40318ee627bd1c1c42fa631de3e838ee72d6a9d991b8fbce4c1d">DIST_LABEL_CCOMP</a>)</td></tr>
<tr class="memdesc:ga8a0b7fdfcb7a13dde018988ba3a43042"><td class="mdescLeft"> </td><td class="mdescRight">Calculates the distance to the closest zero pixel for each pixel of the source image.  <a href="../../d7/d1b/group__imgproc__misc.html#ga8a0b7fdfcb7a13dde018988ba3a43042">More...</a><br/></td></tr>
<tr class="separator:ga8a0b7fdfcb7a13dde018988ba3a43042"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga25c259e7e2fa2ac70de4606ea800f12f"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d1b/group__imgproc__misc.html#ga25c259e7e2fa2ac70de4606ea800f12f">cv::distanceTransform</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst, int distanceType, int maskSize, int dstType=<a class="el" href="../../d1/d1b/group__core__hal__interface.html#ga4a3def5d72b74bed31f5f8ab7676099c">CV_32F</a>)</td></tr>
<tr class="separator:ga25c259e7e2fa2ac70de4606ea800f12f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaf1f55a048f8a45bc3383586e80b1f0d0"><td align="right" class="memItemLeft" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d1b/group__imgproc__misc.html#gaf1f55a048f8a45bc3383586e80b1f0d0">cv::floodFill</a> (<a class="el" href="../../dc/d84/group__core__basic.html#gaf77c9a14ef956c50c1efd4547f444e63">InputOutputArray</a> image, <a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> seedPoint, <a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a> newVal, <a class="el" href="../../dc/d84/group__core__basic.html#ga11d95de507098e90bad732b9345402e8">Rect</a> *rect=0, <a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a> loDiff=<a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a>(), <a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a> upDiff=<a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a>(), int flags=4)</td></tr>
<tr class="separator:gaf1f55a048f8a45bc3383586e80b1f0d0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga366aae45a6c1289b341d140839f18717"><td align="right" class="memItemLeft" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d1b/group__imgproc__misc.html#ga366aae45a6c1289b341d140839f18717">cv::floodFill</a> (<a class="el" href="../../dc/d84/group__core__basic.html#gaf77c9a14ef956c50c1efd4547f444e63">InputOutputArray</a> image, <a class="el" href="../../dc/d84/group__core__basic.html#gaf77c9a14ef956c50c1efd4547f444e63">InputOutputArray</a> mask, <a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> seedPoint, <a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a> newVal, <a class="el" href="../../dc/d84/group__core__basic.html#ga11d95de507098e90bad732b9345402e8">Rect</a> *rect=0, <a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a> loDiff=<a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a>(), <a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a> upDiff=<a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a>(), int flags=4)</td></tr>
<tr class="memdesc:ga366aae45a6c1289b341d140839f18717"><td class="mdescLeft"> </td><td class="mdescRight">Fills a connected component with the given color.  <a href="../../d7/d1b/group__imgproc__misc.html#ga366aae45a6c1289b341d140839f18717">More...</a><br/></td></tr>
<tr class="separator:ga366aae45a6c1289b341d140839f18717"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gadeaf38d7701d7ad371278d663c50c77d"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d1b/group__imgproc__misc.html#gadeaf38d7701d7ad371278d663c50c77d">cv::integral</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> <a class="el" href="../../d2/de8/group__core__array.html#ga716e10a2dd9e228e4d3c95818f106722">sum</a>, int sdepth=-1)</td></tr>
<tr class="separator:gadeaf38d7701d7ad371278d663c50c77d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga8408f27268badd5478b9d3e39124d645"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d1b/group__imgproc__misc.html#ga8408f27268badd5478b9d3e39124d645">cv::integral</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> <a class="el" href="../../d2/de8/group__core__array.html#ga716e10a2dd9e228e4d3c95818f106722">sum</a>, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> sqsum, int sdepth=-1, int sqdepth=-1)</td></tr>
<tr class="separator:ga8408f27268badd5478b9d3e39124d645"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga97b87bec26908237e8ba0f6e96d23e28"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d1b/group__imgproc__misc.html#ga97b87bec26908237e8ba0f6e96d23e28">cv::integral</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> <a class="el" href="../../d2/de8/group__core__array.html#ga716e10a2dd9e228e4d3c95818f106722">sum</a>, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> sqsum, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> tilted, int sdepth=-1, int sqdepth=-1)</td></tr>
<tr class="memdesc:ga97b87bec26908237e8ba0f6e96d23e28"><td class="mdescLeft"> </td><td class="mdescRight">Calculates the integral of an image.  <a href="../../d7/d1b/group__imgproc__misc.html#ga97b87bec26908237e8ba0f6e96d23e28">More...</a><br/></td></tr>
<tr class="separator:ga97b87bec26908237e8ba0f6e96d23e28"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gae8a4a146d1ca78c626a53577199e9c57"><td align="right" class="memItemLeft" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d1b/group__imgproc__misc.html#gae8a4a146d1ca78c626a53577199e9c57">cv::threshold</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> src, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> dst, double thresh, double maxval, int type)</td></tr>
<tr class="memdesc:gae8a4a146d1ca78c626a53577199e9c57"><td class="mdescLeft"> </td><td class="mdescRight">Applies a fixed-level threshold to each array element.  <a href="../../d7/d1b/group__imgproc__misc.html#gae8a4a146d1ca78c626a53577199e9c57">More...</a><br/></td></tr>
<tr class="separator:gae8a4a146d1ca78c626a53577199e9c57"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a id="details" name="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="gaa42a3e6ef26247da787bf34030ed772c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa42a3e6ef26247da787bf34030ed772c">◆ </a></span>AdaptiveThresholdTypes</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="../../d7/d1b/group__imgproc__misc.html#gaa42a3e6ef26247da787bf34030ed772c">cv::AdaptiveThresholdTypes</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>adaptive threshold algorithm </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d7/d1b/group__imgproc__misc.html#ga72b913f352e4a1b1b397736707afcde3" title="Applies an adaptive threshold to an array. ">adaptiveThreshold</a> </dd></dl>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggaa42a3e6ef26247da787bf34030ed772cad0c5199ae8637a6b195062fea4789fa9"></a>ADAPTIVE_THRESH_MEAN_C <div class="python_language">Python: cv.ADAPTIVE_THRESH_MEAN_C</div></td><td class="fielddoc"><p>the threshold value \(T(x,y)\) is a mean of the \(\texttt{blockSize} \times \texttt{blockSize}\) neighborhood of \((x, y)\) minus C </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaa42a3e6ef26247da787bf34030ed772caf262a01e7a3f112bbab4e8d8e28182dd"></a>ADAPTIVE_THRESH_GAUSSIAN_C <div class="python_language">Python: cv.ADAPTIVE_THRESH_GAUSSIAN_C</div></td><td class="fielddoc"><p>the threshold value \(T(x, y)\) is a weighted sum (cross-correlation with a Gaussian window) of the \(\texttt{blockSize} \times \texttt{blockSize}\) neighborhood of \((x, y)\) minus C . The default sigma (standard deviation) is used for the specified blockSize . See <a class="el" href="../../d4/d86/group__imgproc__filter.html#gac05a120c1ae92a6060dd0db190a61afa" title="Returns Gaussian filter coefficients. ">getGaussianKernel</a> </p>
</td></tr>
</table>
</div>
</div>
<a id="ga3fe343d63844c40318ee627bd1c1c42f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3fe343d63844c40318ee627bd1c1c42f">◆ </a></span>DistanceTransformLabelTypes</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ga3fe343d63844c40318ee627bd1c1c42f">cv::DistanceTransformLabelTypes</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>distanceTransform algorithm flags </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga3fe343d63844c40318ee627bd1c1c42fa631de3e838ee72d6a9d991b8fbce4c1d"></a>DIST_LABEL_CCOMP <div class="python_language">Python: cv.DIST_LABEL_CCOMP</div></td><td class="fielddoc"><p>each connected component of zeros in src (as well as all the non-zero pixels closest to the connected component) will be assigned the same label </p>
</td></tr>
<tr><td class="fieldname"><a id="gga3fe343d63844c40318ee627bd1c1c42fa5d291835de98b72caa12a9947c2cd92a"></a>DIST_LABEL_PIXEL <div class="python_language">Python: cv.DIST_LABEL_PIXEL</div></td><td class="fielddoc"><p>each zero pixel (and all the non-zero pixels closest to it) gets its own label. </p>
</td></tr>
</table>
</div>
</div>
<a id="gaaa68392323ccf7fad87570e41259b497"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaaa68392323ccf7fad87570e41259b497">◆ </a></span>DistanceTransformMasks</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="../../d7/d1b/group__imgproc__misc.html#gaaa68392323ccf7fad87570e41259b497">cv::DistanceTransformMasks</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Mask size for distance transform. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggaaa68392323ccf7fad87570e41259b497a520d4f90e1e37d13d7592fd295a6b5b2"></a>DIST_MASK_3 <div class="python_language">Python: cv.DIST_MASK_3</div></td><td class="fielddoc"><p>mask=3 </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaaa68392323ccf7fad87570e41259b497a8a8b17ed6012f6ce42e56f302c07d481"></a>DIST_MASK_5 <div class="python_language">Python: cv.DIST_MASK_5</div></td><td class="fielddoc"><p>mask=5 </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaaa68392323ccf7fad87570e41259b497a71e13e06c1d12eabd2acd2669f94f9ca"></a>DIST_MASK_PRECISE <div class="python_language">Python: cv.DIST_MASK_PRECISE</div></td><td class="fielddoc"></td></tr>
</table>
</div>
</div>
<a id="gaa2bfbebbc5c320526897996aafa1d8eb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa2bfbebbc5c320526897996aafa1d8eb">◆ </a></span>DistanceTypes</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="../../d7/d1b/group__imgproc__misc.html#gaa2bfbebbc5c320526897996aafa1d8eb">cv::DistanceTypes</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Distance types for Distance Transform and M-estimators </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d7/d1b/group__imgproc__misc.html#ga8a0b7fdfcb7a13dde018988ba3a43042" title="Calculates the distance to the closest zero pixel for each pixel of the source image. ">distanceTransform</a>, <a class="el" href="../../d3/dc0/group__imgproc__shape.html#gaf849da1fdafa67ee84b1e9a23b93f91f" title="Fits a line to a 2D or 3D point set. ">fitLine</a> </dd></dl>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggaa2bfbebbc5c320526897996aafa1d8ebaa0bb8d897ba16dbf5a3ca96c71219a32"></a>DIST_USER <div class="python_language">Python: cv.DIST_USER</div></td><td class="fielddoc"><p>User defined distance. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaa2bfbebbc5c320526897996aafa1d8ebae5b2dfaf2ba5024d7ce47885001fad86"></a>DIST_L1 <div class="python_language">Python: cv.DIST_L1</div></td><td class="fielddoc"><p>distance = |x1-x2| + |y1-y2| </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaa2bfbebbc5c320526897996aafa1d8ebaff0d1f5be0fc152a56a9b9716d158b96"></a>DIST_L2 <div class="python_language">Python: cv.DIST_L2</div></td><td class="fielddoc"><p>the simple euclidean distance </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaa2bfbebbc5c320526897996aafa1d8eba507b16eb5ef95ea784ca1b3cb7b0d7ee"></a>DIST_C <div class="python_language">Python: cv.DIST_C</div></td><td class="fielddoc"><p>distance = max(|x1-x2|,|y1-y2|) </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaa2bfbebbc5c320526897996aafa1d8eba8f3c18d37e99f7cc58d3605f5c6f9ce9"></a>DIST_L12 <div class="python_language">Python: cv.DIST_L12</div></td><td class="fielddoc"><p>L1-L2 metric: distance = 2(sqrt(1+x*x/2) - 1)) </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaa2bfbebbc5c320526897996aafa1d8ebaea158f5abd2b5e2b4e79b79f55297079"></a>DIST_FAIR <div class="python_language">Python: cv.DIST_FAIR</div></td><td class="fielddoc"><p>distance = c^2(|x|/c-log(1+|x|/c)), c = 1.3998 </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaa2bfbebbc5c320526897996aafa1d8ebaba5e4b3600852b7a59e78e3041be840e"></a>DIST_WELSCH <div class="python_language">Python: cv.DIST_WELSCH</div></td><td class="fielddoc"><p>distance = c^2/2(1-exp(-(x/c)^2)), c = 2.9846 </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaa2bfbebbc5c320526897996aafa1d8ebad701f5622a12450d3b8c85c052e7c520"></a>DIST_HUBER <div class="python_language">Python: cv.DIST_HUBER</div></td><td class="fielddoc"><p>distance = |x|&lt;c ? x^2/2 : c(|x|-c/2), c=1.345 </p>
</td></tr>
</table>
</div>
</div>
<a id="gab87810a476a9cb660435a4cd7871c9eb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab87810a476a9cb660435a4cd7871c9eb">◆ </a></span>FloodFillFlags</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="../../d7/d1b/group__imgproc__misc.html#gab87810a476a9cb660435a4cd7871c9eb">cv::FloodFillFlags</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>floodfill algorithm flags </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggab87810a476a9cb660435a4cd7871c9eba8aafb7a6a87df91c7624d44f4b092fe3"></a>FLOODFILL_FIXED_RANGE <div class="python_language">Python: cv.FLOODFILL_FIXED_RANGE</div></td><td class="fielddoc"><p>If set, the difference between the current pixel and seed pixel is considered. Otherwise, the difference between neighbor pixels is considered (that is, the range is floating). </p>
</td></tr>
<tr><td class="fieldname"><a id="ggab87810a476a9cb660435a4cd7871c9eba7161dca1d0b9e84e5208c7e8021b4d3a"></a>FLOODFILL_MASK_ONLY <div class="python_language">Python: cv.FLOODFILL_MASK_ONLY</div></td><td class="fielddoc"><p>If set, the function does not change the image ( newVal is ignored), and only fills the mask with the value specified in bits 8-16 of flags as described above. This option only make sense in function variants that have the mask parameter. </p>
</td></tr>
</table>
</div>
</div>
<a id="gad43d3e4208d3cf025d8304156b02ba38"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad43d3e4208d3cf025d8304156b02ba38">◆ </a></span>GrabCutClasses</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="../../d7/d1b/group__imgproc__misc.html#gad43d3e4208d3cf025d8304156b02ba38">cv::GrabCutClasses</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>class of the pixel in GrabCut algorithm </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggad43d3e4208d3cf025d8304156b02ba38a889f1ce109543e8aed80a7abbc6dcb39"></a>GC_BGD <div class="python_language">Python: cv.GC_BGD</div></td><td class="fielddoc"><p>an obvious background pixels </p>
</td></tr>
<tr><td class="fieldname"><a id="ggad43d3e4208d3cf025d8304156b02ba38a4757c1f0587bcf6e53e86dee7689a649"></a>GC_FGD <div class="python_language">Python: cv.GC_FGD</div></td><td class="fielddoc"><p>an obvious foreground (object) pixel </p>
</td></tr>
<tr><td class="fieldname"><a id="ggad43d3e4208d3cf025d8304156b02ba38af748414821c7f39fab3493f9eed1eedf"></a>GC_PR_BGD <div class="python_language">Python: cv.GC_PR_BGD</div></td><td class="fielddoc"><p>a possible background pixel </p>
</td></tr>
<tr><td class="fieldname"><a id="ggad43d3e4208d3cf025d8304156b02ba38ad33184b73cb87e08d29e0a3411b7c863"></a>GC_PR_FGD <div class="python_language">Python: cv.GC_PR_FGD</div></td><td class="fielddoc"><p>a possible foreground pixel </p>
</td></tr>
</table>
</div>
</div>
<a id="gaf8b5832ba85e59fc7a98a2afd034e558"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf8b5832ba85e59fc7a98a2afd034e558">◆ </a></span>GrabCutModes</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="../../d7/d1b/group__imgproc__misc.html#gaf8b5832ba85e59fc7a98a2afd034e558">cv::GrabCutModes</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>GrabCut algorithm flags. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggaf8b5832ba85e59fc7a98a2afd034e558a5f8853c1e5a89c4aa2687d1f78a7e550"></a>GC_INIT_WITH_RECT <div class="python_language">Python: cv.GC_INIT_WITH_RECT</div></td><td class="fielddoc"><p>The function initializes the state and the mask using the provided rectangle. After that it runs iterCount iterations of the algorithm. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaf8b5832ba85e59fc7a98a2afd034e558ab01527c7effb50fd1c54d8c4e671ed22"></a>GC_INIT_WITH_MASK <div class="python_language">Python: cv.GC_INIT_WITH_MASK</div></td><td class="fielddoc"><p>The function initializes the state using the provided mask. Note that GC_INIT_WITH_RECT and GC_INIT_WITH_MASK can be combined. Then, all the pixels outside of the ROI are automatically initialized with GC_BGD . </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaf8b5832ba85e59fc7a98a2afd034e558aef3752e3c27c4af9445d0b5590b6aa05"></a>GC_EVAL <div class="python_language">Python: cv.GC_EVAL</div></td><td class="fielddoc"><p>The value means that the algorithm should just resume. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaf8b5832ba85e59fc7a98a2afd034e558a98122ab15c638309a71a1856c3f43a09"></a>GC_EVAL_FREEZE_MODEL <div class="python_language">Python: cv.GC_EVAL_FREEZE_MODEL</div></td><td class="fielddoc"><p>The value means that the algorithm should just run the grabCut algorithm (a single iteration) with the fixed model </p>
</td></tr>
</table>
</div>
</div>
<a id="gaa9e58d2860d4afa658ef70a9b1115576"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa9e58d2860d4afa658ef70a9b1115576">◆ </a></span>ThresholdTypes</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="../../d7/d1b/group__imgproc__misc.html#gaa9e58d2860d4afa658ef70a9b1115576">cv::ThresholdTypes</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>type of the threshold operation </p><div class="image">
<img alt="threshold.png" src="../../threshold.png"/>
<div class="caption">
threshold types</div></div>
 <table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggaa9e58d2860d4afa658ef70a9b1115576a147222a96556ebc1d948b372bcd7ac59"></a>THRESH_BINARY <div class="python_language">Python: cv.THRESH_BINARY</div></td><td class="fielddoc"><p class="formulaDsp">
\[\texttt{dst} (x,y) = \fork{\texttt{maxval}}{if \(\texttt{src}(x,y) &gt; \texttt{thresh}\)}{0}{otherwise}\]
</p>
 </td></tr>
<tr><td class="fieldname"><a id="ggaa9e58d2860d4afa658ef70a9b1115576a19120b1a11d8067576cc24f4d2f03754"></a>THRESH_BINARY_INV <div class="python_language">Python: cv.THRESH_BINARY_INV</div></td><td class="fielddoc"><p class="formulaDsp">
\[\texttt{dst} (x,y) = \fork{0}{if \(\texttt{src}(x,y) &gt; \texttt{thresh}\)}{\texttt{maxval}}{otherwise}\]
</p>
 </td></tr>
<tr><td class="fieldname"><a id="ggaa9e58d2860d4afa658ef70a9b1115576ac7e89a5e95490116e7d2082b3096b2b8"></a>THRESH_TRUNC <div class="python_language">Python: cv.THRESH_TRUNC</div></td><td class="fielddoc"><p class="formulaDsp">
\[\texttt{dst} (x,y) = \fork{\texttt{threshold}}{if \(\texttt{src}(x,y) &gt; \texttt{thresh}\)}{\texttt{src}(x,y)}{otherwise}\]
</p>
 </td></tr>
<tr><td class="fieldname"><a id="ggaa9e58d2860d4afa658ef70a9b1115576a0e50a338a4b711a8c48f06a6b105dd98"></a>THRESH_TOZERO <div class="python_language">Python: cv.THRESH_TOZERO</div></td><td class="fielddoc"><p class="formulaDsp">
\[\texttt{dst} (x,y) = \fork{\texttt{src}(x,y)}{if \(\texttt{src}(x,y) &gt; \texttt{thresh}\)}{0}{otherwise}\]
</p>
 </td></tr>
<tr><td class="fieldname"><a id="ggaa9e58d2860d4afa658ef70a9b1115576a47518a30aae90d799035bdcf0bb39a50"></a>THRESH_TOZERO_INV <div class="python_language">Python: cv.THRESH_TOZERO_INV</div></td><td class="fielddoc"><p class="formulaDsp">
\[\texttt{dst} (x,y) = \fork{0}{if \(\texttt{src}(x,y) &gt; \texttt{thresh}\)}{\texttt{src}(x,y)}{otherwise}\]
</p>
 </td></tr>
<tr><td class="fieldname"><a id="ggaa9e58d2860d4afa658ef70a9b1115576a8e723ef461a5349c391032aee325fe15"></a>THRESH_MASK <div class="python_language">Python: cv.THRESH_MASK</div></td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="ggaa9e58d2860d4afa658ef70a9b1115576a95251923e8e22f368ffa86ba8bce87ff"></a>THRESH_OTSU <div class="python_language">Python: cv.THRESH_OTSU</div></td><td class="fielddoc"><p>flag, use Otsu algorithm to choose the optimal threshold value </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaa9e58d2860d4afa658ef70a9b1115576a22ffcf680811aed95be6c7f5cd809621"></a>THRESH_TRIANGLE <div class="python_language">Python: cv.THRESH_TRIANGLE</div></td><td class="fielddoc"><p>flag, use Triangle algorithm to choose the optimal threshold value </p>
</td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga72b913f352e4a1b1b397736707afcde3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga72b913f352e4a1b1b397736707afcde3">◆ </a></span>adaptiveThreshold()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::adaptiveThreshold </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>maxValue</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>adaptiveMethod</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>thresholdType</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>blockSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>C</em> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.adaptiveThreshold(</td><td class="paramname">src, maxValue, adaptiveMethod, thresholdType, blockSize, C[, dst]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Applies an adaptive threshold to an array. </p>
<p>The function transforms a grayscale image to a binary image according to the formulae:</p><ul>
<li><b>THRESH_BINARY</b> <p class="formulaDsp">
\[dst(x,y) = \fork{\texttt{maxValue}}{if \(src(x,y) &gt; T(x,y)\)}{0}{otherwise}\]
</p>
</li>
<li><b>THRESH_BINARY_INV</b> <p class="formulaDsp">
\[dst(x,y) = \fork{0}{if \(src(x,y) &gt; T(x,y)\)}{\texttt{maxValue}}{otherwise}\]
</p>
 where \(T(x,y)\) is a threshold calculated individually for each pixel (see adaptiveMethod parameter).</li>
</ul>
<p>The function can process the image in-place.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>Source 8-bit single-channel image. </td></tr>
    <tr><td class="paramname">dst</td><td>Destination image of the same size and the same type as src. </td></tr>
    <tr><td class="paramname">maxValue</td><td>Non-zero value assigned to the pixels for which the condition is satisfied </td></tr>
    <tr><td class="paramname">adaptiveMethod</td><td>Adaptive thresholding algorithm to use, see <a class="el" href="../../d7/d1b/group__imgproc__misc.html#gaa42a3e6ef26247da787bf34030ed772c">AdaptiveThresholdTypes</a>. The <a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5aa1de4cff95e3377d6d0cbe7569bd4e9f" title="aaaaaa|abcdefgh|hhhhhhh ">BORDER_REPLICATE</a> | <a class="el" href="../../d2/de8/group__core__array.html#gga209f2f4869e304c82d07739337eae7c5a4fcb77ae62e1e1336c1c2b24a441995c" title="do not look outside of ROI ">BORDER_ISOLATED</a> is used to process boundaries. </td></tr>
    <tr><td class="paramname">thresholdType</td><td>Thresholding type that must be either <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa9e58d2860d4afa658ef70a9b1115576a147222a96556ebc1d948b372bcd7ac59" title=" ">THRESH_BINARY</a> or <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa9e58d2860d4afa658ef70a9b1115576a19120b1a11d8067576cc24f4d2f03754" title=" ">THRESH_BINARY_INV</a>, see <a class="el" href="../../d7/d1b/group__imgproc__misc.html#gaa9e58d2860d4afa658ef70a9b1115576">ThresholdTypes</a>. </td></tr>
    <tr><td class="paramname">blockSize</td><td>Size of a pixel neighborhood that is used to calculate a threshold value for the pixel: 3, 5, 7, and so on. </td></tr>
    <tr><td class="paramname">C</td><td>Constant subtracted from the mean or weighted mean (see the details below). Normally, it is positive but may be zero or negative as well.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d7/d1b/group__imgproc__misc.html#gae8a4a146d1ca78c626a53577199e9c57" title="Applies a fixed-level threshold to each array element. ">threshold</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#ga8c45db9afe636703801b0b2e440fce37" title="Blurs an image using the normalized box filter. ">blur</a>, <a class="el" href="../../d4/d86/group__imgproc__filter.html#gaabe8c836e97159a9193fb0b11ac52cf1" title="Blurs an image using a Gaussian filter. ">GaussianBlur</a> </dd></dl>
</div>
</div>
<a id="ga5e76540a679333d7c6cd0617c452c23d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5e76540a679333d7c6cd0617c452c23d">◆ </a></span>blendLinear()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::blendLinear </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>weights1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>weights2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.blendLinear(</td><td class="paramname">src1, src2, weights1, weights2[, dst]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Performs linear blending of two images: </p><p class="formulaDsp">
\[ \texttt{dst}(i,j) = \texttt{weights1}(i,j)*\texttt{src1}(i,j) + \texttt{weights2}(i,j)*\texttt{src2}(i,j) \]
</p>
 <dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src1</td><td>It has a type of <a class="el" href="../../d1/d1b/group__core__hal__interface.html#ga78c5506f62d99edd7e83aba259250394">CV_8UC(n)</a> or <a class="el" href="../../d1/d1b/group__core__hal__interface.html#ga56e67b727727f2f9b73a4b62f0c4b2b5">CV_32FC(n)</a>, where n is a positive integer. </td></tr>
    <tr><td class="paramname">src2</td><td>It has the same type and size as src1. </td></tr>
    <tr><td class="paramname">weights1</td><td>It has a type of CV_32FC1 and the same size with src1. </td></tr>
    <tr><td class="paramname">weights2</td><td>It has a type of CV_32FC1 and the same size with src1. </td></tr>
    <tr><td class="paramname">dst</td><td>It is created if it does not have the same size and type with src1. </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
<a id="ga8a0b7fdfcb7a13dde018988ba3a43042"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8a0b7fdfcb7a13dde018988ba3a43042">◆ </a></span>distanceTransform() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::distanceTransform </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>labels</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>distanceType</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>maskSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>labelType</em> = <code><a class="el" href="../../d7/d1b/group__imgproc__misc.html#gga3fe343d63844c40318ee627bd1c1c42fa631de3e838ee72d6a9d991b8fbce4c1d">DIST_LABEL_CCOMP</a></code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.distanceTransform(</td><td class="paramname">src, distanceType, maskSize[, dst[, dstType]]</td><td>)</td></tr><tr><td style="width: 20px;"></td><td>dst, labels</td><td>=</td><td>cv.distanceTransformWithLabels(</td><td class="paramname">src, distanceType, maskSize[, dst[, labels[, labelType]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Calculates the distance to the closest zero pixel for each pixel of the source image. </p>
<p>The function <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ga8a0b7fdfcb7a13dde018988ba3a43042" title="Calculates the distance to the closest zero pixel for each pixel of the source image. ">cv::distanceTransform</a> calculates the approximate or precise distance from every binary image pixel to the nearest zero pixel. For zero image pixels, the distance will obviously be zero.</p>
<p>When maskSize == <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaaa68392323ccf7fad87570e41259b497a71e13e06c1d12eabd2acd2669f94f9ca">DIST_MASK_PRECISE</a> and distanceType == <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa2bfbebbc5c320526897996aafa1d8ebaff0d1f5be0fc152a56a9b9716d158b96" title="the simple euclidean distance ">DIST_L2</a> , the function runs the algorithm described in <a class="el" href="../../d0/de3/citelist.html#CITEREF_Felzenszwalb04">[72]</a> . This algorithm is parallelized with the TBB library.</p>
<p>In other cases, the algorithm <a class="el" href="../../d0/de3/citelist.html#CITEREF_Borgefors86">[28]</a> is used. This means that for a pixel the function finds the shortest path to the nearest zero pixel consisting of basic shifts: horizontal, vertical, diagonal, or knight's move (the latest is available for a \(5\times 5\) mask). The overall distance is calculated as a sum of these basic distances. Since the distance function should be symmetric, all of the horizontal and vertical shifts must have the same cost (denoted as a ), all the diagonal shifts must have the same cost (denoted as <code>b</code>), and all knight's moves must have the same cost (denoted as <code>c</code>). For the <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa2bfbebbc5c320526897996aafa1d8eba507b16eb5ef95ea784ca1b3cb7b0d7ee" title="distance = max(|x1-x2|,|y1-y2|) ">DIST_C</a> and <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa2bfbebbc5c320526897996aafa1d8ebae5b2dfaf2ba5024d7ce47885001fad86" title="distance = |x1-x2| + |y1-y2| ">DIST_L1</a> types, the distance is calculated precisely, whereas for <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa2bfbebbc5c320526897996aafa1d8ebaff0d1f5be0fc152a56a9b9716d158b96" title="the simple euclidean distance ">DIST_L2</a> (Euclidean distance) the distance can be calculated only with a relative error (a \(5\times 5\) mask gives more accurate results). For <code>a</code>,<code>b</code>, and <code>c</code>, OpenCV uses the values suggested in the original paper:</p><ul>
<li>DIST_L1: <code>a = 1, b = 2</code></li>
<li>DIST_L2:<ul>
<li><code>3 x 3</code>: <code>a=0.955, b=1.3693</code></li>
<li><code>5 x 5</code>: <code>a=1, b=1.4, c=2.1969</code></li>
</ul>
</li>
<li>DIST_C: <code>a = 1, b = 1</code></li>
</ul>
<p>Typically, for a fast, coarse distance estimation <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa2bfbebbc5c320526897996aafa1d8ebaff0d1f5be0fc152a56a9b9716d158b96" title="the simple euclidean distance ">DIST_L2</a>, a \(3\times 3\) mask is used. For a more accurate distance estimation <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa2bfbebbc5c320526897996aafa1d8ebaff0d1f5be0fc152a56a9b9716d158b96" title="the simple euclidean distance ">DIST_L2</a>, a \(5\times 5\) mask or the precise algorithm is used. Note that both the precise and the approximate algorithms are linear on the number of pixels.</p>
<p>This variant of the function does not only compute the minimum distance for each pixel \((x, y)\) but also identifies the nearest connected component consisting of zero pixels (labelType==<a class="el" href="../../d7/d1b/group__imgproc__misc.html#gga3fe343d63844c40318ee627bd1c1c42fa631de3e838ee72d6a9d991b8fbce4c1d">DIST_LABEL_CCOMP</a>) or the nearest zero pixel (labelType==<a class="el" href="../../d7/d1b/group__imgproc__misc.html#gga3fe343d63844c40318ee627bd1c1c42fa5d291835de98b72caa12a9947c2cd92a">DIST_LABEL_PIXEL</a>). Index of the component/pixel is stored in <code>labels(x, y)</code>. When labelType==<a class="el" href="../../d7/d1b/group__imgproc__misc.html#gga3fe343d63844c40318ee627bd1c1c42fa631de3e838ee72d6a9d991b8fbce4c1d">DIST_LABEL_CCOMP</a>, the function automatically finds connected components of zero pixels in the input image and marks them with distinct labels. When labelType==<a class="el" href="../../d7/d1b/group__imgproc__misc.html#gga3fe343d63844c40318ee627bd1c1c42fa5d291835de98b72caa12a9947c2cd92a">DIST_LABEL_PIXEL</a>, the function scans through the input image and marks all the zero pixels with distinct labels.</p>
<p>In this mode, the complexity is still linear. That is, the function provides a very fast way to compute the Voronoi diagram for a binary image. Currently, the second variant can use only the approximate distance transform algorithm, i.e. maskSize=<a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaaa68392323ccf7fad87570e41259b497a71e13e06c1d12eabd2acd2669f94f9ca">DIST_MASK_PRECISE</a> is not supported yet.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>8-bit, single-channel (binary) source image. </td></tr>
    <tr><td class="paramname">dst</td><td>Output image with calculated distances. It is a 8-bit or 32-bit floating-point, single-channel image of the same size as src. </td></tr>
    <tr><td class="paramname">labels</td><td>Output 2D array of labels (the discrete Voronoi diagram). It has the type CV_32SC1 and the same size as src. </td></tr>
    <tr><td class="paramname">distanceType</td><td>Type of distance, see <a class="el" href="../../d7/d1b/group__imgproc__misc.html#gaa2bfbebbc5c320526897996aafa1d8eb">DistanceTypes</a> </td></tr>
    <tr><td class="paramname">maskSize</td><td>Size of the distance transform mask, see <a class="el" href="../../d7/d1b/group__imgproc__misc.html#gaaa68392323ccf7fad87570e41259b497" title="Mask size for distance transform. ">DistanceTransformMasks</a>. <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaaa68392323ccf7fad87570e41259b497a71e13e06c1d12eabd2acd2669f94f9ca">DIST_MASK_PRECISE</a> is not supported by this variant. In case of the <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa2bfbebbc5c320526897996aafa1d8ebae5b2dfaf2ba5024d7ce47885001fad86" title="distance = |x1-x2| + |y1-y2| ">DIST_L1</a> or <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa2bfbebbc5c320526897996aafa1d8eba507b16eb5ef95ea784ca1b3cb7b0d7ee" title="distance = max(|x1-x2|,|y1-y2|) ">DIST_C</a> distance type, the parameter is forced to 3 because a \(3\times 3\) mask gives the same result as \(5\times 5\) or any larger aperture. </td></tr>
    <tr><td class="paramname">labelType</td><td>Type of the label array to build, see <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ga3fe343d63844c40318ee627bd1c1c42f" title="distanceTransform algorithm flags ">DistanceTransformLabelTypes</a>. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d4/dc6/samples_2cpp_2distrans_8cpp-example.html#a6">samples/cpp/distrans.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="ga25c259e7e2fa2ac70de4606ea800f12f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga25c259e7e2fa2ac70de4606ea800f12f">◆ </a></span>distanceTransform() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::distanceTransform </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>distanceType</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>maskSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>dstType</em> = <code><a class="el" href="../../d1/d1b/group__core__hal__interface.html#ga4a3def5d72b74bed31f5f8ab7676099c">CV_32F</a></code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>dst</td><td>=</td><td>cv.distanceTransform(</td><td class="paramname">src, distanceType, maskSize[, dst[, dstType]]</td><td>)</td></tr><tr><td style="width: 20px;"></td><td>dst, labels</td><td>=</td><td>cv.distanceTransformWithLabels(</td><td class="paramname">src, distanceType, maskSize[, dst[, labels[, labelType]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>8-bit, single-channel (binary) source image. </td></tr>
    <tr><td class="paramname">dst</td><td>Output image with calculated distances. It is a 8-bit or 32-bit floating-point, single-channel image of the same size as src . </td></tr>
    <tr><td class="paramname">distanceType</td><td>Type of distance, see <a class="el" href="../../d7/d1b/group__imgproc__misc.html#gaa2bfbebbc5c320526897996aafa1d8eb">DistanceTypes</a> </td></tr>
    <tr><td class="paramname">maskSize</td><td>Size of the distance transform mask, see <a class="el" href="../../d7/d1b/group__imgproc__misc.html#gaaa68392323ccf7fad87570e41259b497" title="Mask size for distance transform. ">DistanceTransformMasks</a>. In case of the <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa2bfbebbc5c320526897996aafa1d8ebae5b2dfaf2ba5024d7ce47885001fad86" title="distance = |x1-x2| + |y1-y2| ">DIST_L1</a> or <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa2bfbebbc5c320526897996aafa1d8eba507b16eb5ef95ea784ca1b3cb7b0d7ee" title="distance = max(|x1-x2|,|y1-y2|) ">DIST_C</a> distance type, the parameter is forced to 3 because a \(3\times 3\) mask gives the same result as \(5\times 5\) or any larger aperture. </td></tr>
    <tr><td class="paramname">dstType</td><td>Type of output image. It can be CV_8U or CV_32F. Type CV_8U can be used only for the first variant of the function and distanceType == <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa2bfbebbc5c320526897996aafa1d8ebae5b2dfaf2ba5024d7ce47885001fad86" title="distance = |x1-x2| + |y1-y2| ">DIST_L1</a>. </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
<a id="gaf1f55a048f8a45bc3383586e80b1f0d0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf1f55a048f8a45bc3383586e80b1f0d0">◆ </a></span>floodFill() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cv::floodFill </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaf77c9a14ef956c50c1efd4547f444e63">InputOutputArray</a> </td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> </td>
          <td class="paramname"><em>seedPoint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a> </td>
          <td class="paramname"><em>newVal</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga11d95de507098e90bad732b9345402e8">Rect</a> * </td>
          <td class="paramname"><em>rect</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a> </td>
          <td class="paramname"><em>loDiff</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a> </td>
          <td class="paramname"><em>upDiff</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>flags</em> = <code>4</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval, image, mask, rect</td><td>=</td><td>cv.floodFill(</td><td class="paramname">image, mask, seedPoint, newVal[, loDiff[, upDiff[, flags]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.</p>
<p>variant without <code>mask</code> parameter </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d1/d17/samples_2cpp_2ffilldemo_8cpp-example.html#a12">samples/cpp/ffilldemo.cpp</a>.</dd>
</dl>
</div>
</div>
<a id="ga366aae45a6c1289b341d140839f18717"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga366aae45a6c1289b341d140839f18717">◆ </a></span>floodFill() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cv::floodFill </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaf77c9a14ef956c50c1efd4547f444e63">InputOutputArray</a> </td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaf77c9a14ef956c50c1efd4547f444e63">InputOutputArray</a> </td>
          <td class="paramname"><em>mask</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> </td>
          <td class="paramname"><em>seedPoint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a> </td>
          <td class="paramname"><em>newVal</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga11d95de507098e90bad732b9345402e8">Rect</a> * </td>
          <td class="paramname"><em>rect</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a> </td>
          <td class="paramname"><em>loDiff</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a> </td>
          <td class="paramname"><em>upDiff</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a>()</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>flags</em> = <code>4</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval, image, mask, rect</td><td>=</td><td>cv.floodFill(</td><td class="paramname">image, mask, seedPoint, newVal[, loDiff[, upDiff[, flags]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Fills a connected component with the given color. </p>
<p>The function <a class="el" href="../../d7/d1b/group__imgproc__misc.html#gaf1f55a048f8a45bc3383586e80b1f0d0">cv::floodFill</a> fills a connected component starting from the seed point with the specified color. The connectivity is determined by the color/brightness closeness of the neighbor pixels. The pixel at \((x,y)\) is considered to belong to the repainted domain if:</p>
<ul>
<li>in case of a grayscale image and floating range <p class="formulaDsp">
\[\texttt{src} (x',y')- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} (x',y')+ \texttt{upDiff}\]
</p>
</li>
<li>in case of a grayscale image and fixed range <p class="formulaDsp">
\[\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)+ \texttt{upDiff}\]
</p>
</li>
<li>in case of a color image and floating range <p class="formulaDsp">
\[\texttt{src} (x',y')_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} (x',y')_r+ \texttt{upDiff} _r,\]
</p>
 <p class="formulaDsp">
\[\texttt{src} (x',y')_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} (x',y')_g+ \texttt{upDiff} _g\]
</p>
 and <p class="formulaDsp">
\[\texttt{src} (x',y')_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} (x',y')_b+ \texttt{upDiff} _b\]
</p>
</li>
<li>in case of a color image and fixed range <p class="formulaDsp">
\[\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r+ \texttt{upDiff} _r,\]
</p>
 <p class="formulaDsp">
\[\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g+ \texttt{upDiff} _g\]
</p>
 and <p class="formulaDsp">
\[\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b+ \texttt{upDiff} _b\]
</p>
</li>
</ul>
<p>where \(src(x',y')\) is the value of one of pixel neighbors that is already known to belong to the component. That is, to be added to the connected component, a color/brightness of the pixel should be close enough to:</p><ul>
<li>Color/brightness of one of its neighbors that already belong to the connected component in case of a floating range.</li>
<li>Color/brightness of the seed point in case of a fixed range.</li>
</ul>
<p>Use these functions to either mark a connected component with the specified color in-place, or build a mask and then extract the contour, or copy the region to another image, and so on.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">image</td><td>Input/output 1- or 3-channel, 8-bit, or floating-point image. It is modified by the function unless the <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggab87810a476a9cb660435a4cd7871c9eba7161dca1d0b9e84e5208c7e8021b4d3a">FLOODFILL_MASK_ONLY</a> flag is set in the second variant of the function. See the details below. </td></tr>
    <tr><td class="paramname">mask</td><td>Operation mask that should be a single-channel 8-bit image, 2 pixels wider and 2 pixels taller than image. Since this is both an input and output parameter, you must take responsibility of initializing it. Flood-filling cannot go across non-zero pixels in the input mask. For example, an edge detector output can be used as a mask to stop filling at edges. On output, pixels in the mask corresponding to filled pixels in the image are set to 1 or to the a value specified in flags as described below. Additionally, the function fills the border of the mask with ones to simplify internal processing. It is therefore possible to use the same mask in multiple calls to the function to make sure the filled areas do not overlap. </td></tr>
    <tr><td class="paramname">seedPoint</td><td>Starting point. </td></tr>
    <tr><td class="paramname">newVal</td><td>New value of the repainted domain pixels. </td></tr>
    <tr><td class="paramname">loDiff</td><td>Maximal lower brightness/color difference between the currently observed pixel and one of its neighbors belonging to the component, or a seed pixel being added to the component. </td></tr>
    <tr><td class="paramname">upDiff</td><td>Maximal upper brightness/color difference between the currently observed pixel and one of its neighbors belonging to the component, or a seed pixel being added to the component. </td></tr>
    <tr><td class="paramname">rect</td><td>Optional output parameter set by the function to the minimum bounding rectangle of the repainted domain. </td></tr>
    <tr><td class="paramname">flags</td><td>Operation flags. The first 8 bits contain a connectivity value. The default value of 4 means that only the four nearest neighbor pixels (those that share an edge) are considered. A connectivity value of 8 means that the eight nearest neighbor pixels (those that share a corner) will be considered. The next 8 bits (8-16) contain a value between 1 and 255 with which to fill the mask (the default value is 1). For example, 4 | ( 255 &lt;&lt; 8 ) will consider 4 nearest neighbours and fill the mask with a value of 255. The following additional options occupy higher bits and therefore may be further combined with the connectivity and mask fill values using bit-wise or (|), see <a class="el" href="../../d7/d1b/group__imgproc__misc.html#gab87810a476a9cb660435a4cd7871c9eb" title="floodfill algorithm flags ">FloodFillFlags</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>Since the mask is larger than the filled image, a pixel \((x, y)\) in image corresponds to the pixel \((x+1, y+1)\) in the mask .</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d3/dc0/group__imgproc__shape.html#gadf1ad6a0b82947fa1fe3c3d497f260e0" title="Finds contours in a binary image. ">findContours</a> </dd></dl>
</div>
</div>
<a id="gadeaf38d7701d7ad371278d663c50c77d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gadeaf38d7701d7ad371278d663c50c77d">◆ </a></span>integral() <span class="overload">[1/3]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::integral </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>sum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>sdepth</em> = <code>-1</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>sum</td><td>=</td><td>cv.integral(</td><td class="paramname">src[, sum[, sdepth]]</td><td>)</td></tr><tr><td style="width: 20px;"></td><td>sum, sqsum</td><td>=</td><td>cv.integral2(</td><td class="paramname">src[, sum[, sqsum[, sdepth[, sqdepth]]]]</td><td>)</td></tr><tr><td style="width: 20px;"></td><td>sum, sqsum, tilted</td><td>=</td><td>cv.integral3(</td><td class="paramname">src[, sum[, sqsum[, tilted[, sdepth[, sqdepth]]]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
</div>
</div>
<a id="ga8408f27268badd5478b9d3e39124d645"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8408f27268badd5478b9d3e39124d645">◆ </a></span>integral() <span class="overload">[2/3]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::integral </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>sum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>sqsum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>sdepth</em> = <code>-1</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>sqdepth</em> = <code>-1</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>sum</td><td>=</td><td>cv.integral(</td><td class="paramname">src[, sum[, sdepth]]</td><td>)</td></tr><tr><td style="width: 20px;"></td><td>sum, sqsum</td><td>=</td><td>cv.integral2(</td><td class="paramname">src[, sum[, sqsum[, sdepth[, sqdepth]]]]</td><td>)</td></tr><tr><td style="width: 20px;"></td><td>sum, sqsum, tilted</td><td>=</td><td>cv.integral3(</td><td class="paramname">src[, sum[, sqsum[, tilted[, sdepth[, sqdepth]]]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>
</div>
</div>
<a id="ga97b87bec26908237e8ba0f6e96d23e28"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga97b87bec26908237e8ba0f6e96d23e28">◆ </a></span>integral() <span class="overload">[3/3]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::integral </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>sum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>sqsum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>tilted</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>sdepth</em> = <code>-1</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>sqdepth</em> = <code>-1</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>sum</td><td>=</td><td>cv.integral(</td><td class="paramname">src[, sum[, sdepth]]</td><td>)</td></tr><tr><td style="width: 20px;"></td><td>sum, sqsum</td><td>=</td><td>cv.integral2(</td><td class="paramname">src[, sum[, sqsum[, sdepth[, sqdepth]]]]</td><td>)</td></tr><tr><td style="width: 20px;"></td><td>sum, sqsum, tilted</td><td>=</td><td>cv.integral3(</td><td class="paramname">src[, sum[, sqsum[, tilted[, sdepth[, sqdepth]]]]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Calculates the integral of an image. </p>
<p>The function calculates one or more integral images for the source image as follows:</p>
<p class="formulaDsp">
\[\texttt{sum} (X,Y) = \sum _{x&lt;X,y&lt;Y} \texttt{image} (x,y)\]
</p>
<p class="formulaDsp">
\[\texttt{sqsum} (X,Y) = \sum _{x&lt;X,y&lt;Y} \texttt{image} (x,y)^2\]
</p>
<p class="formulaDsp">
\[\texttt{tilted} (X,Y) = \sum _{y&lt;Y,abs(x-X+1) \leq Y-y-1} \texttt{image} (x,y)\]
</p>
<p>Using these integral images, you can calculate sum, mean, and standard deviation over a specific up-right or rotated rectangular region of the image in a constant time, for example:</p>
<p class="formulaDsp">
\[\sum _{x_1 \leq x &lt; x_2, \, y_1 \leq y &lt; y_2} \texttt{image} (x,y) = \texttt{sum} (x_2,y_2)- \texttt{sum} (x_1,y_2)- \texttt{sum} (x_2,y_1)+ \texttt{sum} (x_1,y_1)\]
</p>
<p>It makes possible to do a fast blurring or fast block correlation with a variable window size, for example. In case of multi-channel images, sums for each channel are accumulated independently.</p>
<p>As a practical example, the next figure shows the calculation of the integral of a straight rectangle Rect(3,3,3,2) and of a tilted rectangle Rect(5,1,2,3) . The selected pixels in the original image are shown, as well as the relative pixels in the integral images sum and tilted .</p>
<div class="image">
<img alt="integral.png" src="../../integral.png"/>
<div class="caption">
integral calculation example</div></div>
 <dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>input image as \(W \times H\), 8-bit or floating-point (32f or 64f). </td></tr>
    <tr><td class="paramname">sum</td><td>integral image as \((W+1)\times (H+1)\) , 32-bit integer or floating-point (32f or 64f). </td></tr>
    <tr><td class="paramname">sqsum</td><td>integral image for squared pixel values; it is \((W+1)\times (H+1)\), double-precision floating-point (64f) array. </td></tr>
    <tr><td class="paramname">tilted</td><td>integral for the image rotated by 45 degrees; it is \((W+1)\times (H+1)\) array with the same data type as sum. </td></tr>
    <tr><td class="paramname">sdepth</td><td>desired depth of the integral and the tilted integral images, CV_32S, CV_32F, or CV_64F. </td></tr>
    <tr><td class="paramname">sqdepth</td><td>desired depth of the integral image of squared pixel values, CV_32F or CV_64F. </td></tr>
  </table>
  </dd>
</dl>
</div>
</div>
<a id="gae8a4a146d1ca78c626a53577199e9c57"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae8a4a146d1ca78c626a53577199e9c57">◆ </a></span>threshold()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double cv::threshold </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>dst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>thresh</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double </td>
          <td class="paramname"><em>maxval</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int </td>
          <td class="paramname"><em>type</em> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval, dst</td><td>=</td><td>cv.threshold(</td><td class="paramname">src, thresh, maxval, type[, dst]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">opencv2/imgproc.hpp</a>&gt;</code></p>
<p>Applies a fixed-level threshold to each array element. </p>
<p>The function applies fixed-level thresholding to a multiple-channel array. The function is typically used to get a bi-level (binary) image out of a grayscale image ( <a class="el" href="../../d2/de8/group__core__array.html#ga303cfb72acf8cbb36d884650c09a3a97" title="Performs the per-element comparison of two arrays or an array and scalar value. ">compare</a> could be also used for this purpose) or for removing a noise, that is, filtering out pixels with too small or too large values. There are several types of thresholding supported by the function. They are determined by type parameter.</p>
<p>Also, the special values <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa9e58d2860d4afa658ef70a9b1115576a95251923e8e22f368ffa86ba8bce87ff" title="flag, use Otsu algorithm to choose the optimal threshold value ">THRESH_OTSU</a> or <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa9e58d2860d4afa658ef70a9b1115576a22ffcf680811aed95be6c7f5cd809621" title="flag, use Triangle algorithm to choose the optimal threshold value ">THRESH_TRIANGLE</a> may be combined with one of the above values. In these cases, the function determines the optimal threshold value using the Otsu's or Triangle algorithm and uses it instead of the specified thresh.</p>
<dl class="section note"><dt>Note</dt><dd>Currently, the Otsu's and Triangle methods are implemented only for 8-bit single-channel images.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>input array (multiple-channel, 8-bit or 32-bit floating point). </td></tr>
    <tr><td class="paramname">dst</td><td>output array of the same size and type and the same number of channels as src. </td></tr>
    <tr><td class="paramname">thresh</td><td>threshold value. </td></tr>
    <tr><td class="paramname">maxval</td><td>maximum value to use with the <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa9e58d2860d4afa658ef70a9b1115576a147222a96556ebc1d948b372bcd7ac59" title=" ">THRESH_BINARY</a> and <a class="el" href="../../d7/d1b/group__imgproc__misc.html#ggaa9e58d2860d4afa658ef70a9b1115576a19120b1a11d8067576cc24f4d2f03754" title=" ">THRESH_BINARY_INV</a> thresholding types. </td></tr>
    <tr><td class="paramname">type</td><td>thresholding type (see <a class="el" href="../../d7/d1b/group__imgproc__misc.html#gaa9e58d2860d4afa658ef70a9b1115576">ThresholdTypes</a>). </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the computed threshold value if Otsu's or Triangle methods used.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../d7/d1b/group__imgproc__misc.html#ga72b913f352e4a1b1b397736707afcde3" title="Applies an adaptive threshold to an array. ">adaptiveThreshold</a>, <a class="el" href="../../d3/dc0/group__imgproc__shape.html#gadf1ad6a0b82947fa1fe3c3d497f260e0" title="Finds contours in a binary image. ">findContours</a>, <a class="el" href="../../d2/de8/group__core__array.html#ga303cfb72acf8cbb36d884650c09a3a97" title="Performs the per-element comparison of two arrays or an array and scalar value. ">compare</a>, <a class="el" href="../../d7/dcc/group__core__utils__softfloat.html#gac48df53b8fd34b87e7b121fa8fd4c379" title="Min and Max functions. ">min</a>, <a class="el" href="../../d7/dcc/group__core__utils__softfloat.html#ga78f988f6cfa6223610298cbd4f86ec66">max</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="../../d1/d17/samples_2cpp_2ffilldemo_8cpp-example.html#a10">samples/cpp/ffilldemo.cpp</a>, <a class="el" href="../../da/d94/samples_2cpp_2tutorial_code_2ml_2introduction_to_pca_2introduction_to_pca_8cpp-example.html#a29">samples/cpp/tutorial_code/ml/introduction_to_pca/introduction_to_pca.cpp</a>, and <a class="el" href="../../de/dc0/samples_2tapi_2squares_8cpp-example.html#a16">samples/tapi/squares.cpp</a>.</dd>
</dl>
</div>
</div>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.6-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 2 2021 11:36:40 for OpenCV by  <a href="http://www.doxygen.org/index.html">
<img alt="doxygen" class="footer" src="../../doxygen.png"/>
</a> 1.8.13
</small></address>
<script type="text/javascript">
//<![CDATA[
addTutorialsButtons();
//]]>
</script>
</body>
</html>
